<?php
//Begin config
	$config["sql_host"] = "localhost";
	$config["sql_user"] = "root";
	$config["sql_pass"] = "";
	$config["db_name"] = "3cards";
//End config
	
//Begin Function
	function db_connection()
	{
		global $config,$data_sql;
		$data_sql = mysql_connect($config["sql_host"], $config["sql_user"], $config["sql_pass"]) or die (mysql_error());
		mysql_select_db($config["db_name"],$data_sql) or die ("Can't select database");
	}
	function db_close()
	{
		global $data_sql;
		@mysql_close($data_sql);
	}
	function clean($str)
	{
		$str = @trim($str);
		if(get_magic_quotes_gpc())
		{
			$str = stripslashes($str);
		}
		return mysql_real_escape_string($str);
	}
//End Function
?>